#{extends 'main.html' /}
<html>

<body>

	<!-- Start Rana Amr 
This section checks the attributes color and font to see what the user has chosen,
and then sets the style based on these choices.
@author Rana Amr
@param -->

	<br>
	<br> ${t.Title.raw()}
	<br> ${t.content.raw()}

	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<!-- End Rana Amr -->
	
	<!-- Start Ragab -->

#{list items:controllers.Tutorials.findUploads(t.id), as:'RegisteredUser'}
#{if RegisteredUser.type =="image"}
 
   <a href="@{Application.photoDownload(RegisteredUser.id)}">DOWNLOAD</a><BR>
   <img id="${RegisteredUser.id}" src="@{Application.userPhoto(RegisteredUser.id)}"><br><br><br>
 
   <br><br><br>
 #{/if}  
 
 #{if RegisteredUser.type =="audio"}
  
  <a href="@{Application.photoDownload(RegisteredUser.id)}">DOWNLOAD</a><BR>
  <embed id="${RegisteredUser.id}" src="@{Application.userPhoto(RegisteredUser.id)}" 
width="200" height="200" autostart="${RegisteredUser.autoplay}" loop="FALSE"> 

</embed>

  <br><br><br>
 #{/if} 
 
 #{if RegisteredUser.type =="video"}

<a href="@{Application.photoDownload(RegisteredUser.id)}">DOWNLOAD</a><BR>
<EMBED id="${RegisteredUser.id}" SRC="@{Application.userPhoto(RegisteredUser.id)}" WIDTH="500" HEIGHT="400" AUTOPLAY="${RegisteredUser.autoplay}" LOOP="false"></EMBED> 
   
   <br><br><br>
 #{/if} 
#{/list}

<li><a href="@{Tutorials.followTut(t.id)}">Follow</a></li>
	
<!--Start Yasmine Abdelhady -->
<img border="0" src="http://www.simplyzesty.com/wp-content/uploads/2012/04/facebook-like.jpg" alt="Pulpit rock" width="46" height="33" />
${t.likeCount}<br>
<!-- End Yasmine Abdelhady -->

	
	
	<button onclick="addFavourites()">Add To Favourites</button>
	<br>


	<button onclick="addFavourites()">Add To Favourites</button>


	<br>
	<button onclick="rate()">Rate</button>



	<form>

		<!--START-----Omnia-->
		<ul>
			<li><a href="@{Tutorials.requestToContribute(t.id)}">Request
					To Contribute</a></li>
		</ul>
		<ul>
			<li><a href="@{Tutorials.likeTutorial(t.id)}">Like </a></li>
		</ul>
		<!--end-----Omnia-->


		<!-- Rana A. Zakaria -->
		<ul>
			<li><a href="@{Tutorials.viewPublicComments()}">Show public
					comments </a></li>
		</ul>
		<!-- End Rana A. Zakaria -->

		<!-- Rana A. Zakaria -->
		<ul>
			<li><a href="@{Tutorials.viewPrivateComments()}">Show
					private comments </a></li>
		</ul>
		<!-- End Rana A. Zakaria -->


=
   <!-- Haidy -->
<a href="@{Tutorials.EditTutorial(t.id)}" >Edit this Tutorial</a><br><br>
<!--END-----Haidy-->

<!--START Haidy-->
	<form action="@{Tutorials.EditTutorial()}" method="post">
		<a href="/Tutorials/EditTutorial?tutId=${t.id}"><input type="button" value="Edit This Tutorial" /></a>
	</form>
<!--END Haidy-->


<a href="@{Tutorials.viewListsToRecommend()}" >Go to your lists To recommend</a>


		<!--start-----shaymaa-->
		<form action="@{Reviews.viewReview()}" method="POST">
			<a href="ViewReview"><input type="button" value="View Review" /></a>
		</form>
		<!--end-----shaymaa-->

		<!--start-----shaymaa-->
		<form action="@{Tutorials.browsRelations()}" method="POST">
			<a href="BrowsRelations"><input type="button"
				value="browse Relations" /></a>
		</form>
		<!--end-----shaymaa-->




<!-- samar and hadeer -->


<a href="@{Exercises.enterName(t.id)}">Create a New Exercise</a>




<!-- Mahmoud (Review button, is viewed only if tutorial is in draft mode) -->

#{if t.status == "draft"}
<a href = "@{Reviews.addReview(t.id)}">Review this Tutorial !</a>
#{/if}

<!-- end Mahmoud -->





		<!-- Rana A. Zakaria -->
		<form action="@{Tutorials.createPublicComment()}" method="POST">
			<input type="text" name="commentBody" /> <input type="submit"
				value="Post a public comment" />
		</form>
		<!-- end Rana A. Zakaria -->

		<!-- Rana A. Zakaria -->
		<form action="@{Tutorials.createPrivateComment()}" method="POST">
			<input type="text" name="commentBody" /> <input type="submit"
				value="Post a private comment" />
		</form>
		<!-- end Rana A. Zakaria -->

		<!-- ragab -->
		<ul>
			<li><a href="@{Application.photoView()}">view Media list</a></li>
		</ul>
		<!-- /ragab -->


	</form>

</body>